<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>global对象的编码和解码方法</title>
    
</head>
<body>
    <script type="text/javascript">
        // URI
        var uri = 'http://www.tanjinlin.xyz'; 
        console.log(encodeURI(uri));
        console.log(decodeURI(uri));
        console.log(encodeURIComponent(uri));
        console.log(decodeURIComponent(encodeURIComponent(uri)));
    </script>
</body>
</html>